//
//  CountryMyCollectionViewCell.m
//  AroundTheWorld
//
//  Created by dllo on 16/5/19.
//  Copyright © 2016年 IfelseGo an. All rights reserved.
//

#import "CountryMyCollectionViewCell.h"

@implementation CountryMyCollectionViewCell

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
          [self createSubviews];
    }
    return self;
}

-(void)createSubviews
{
    self.myImageView = [[UIImageView alloc] initWithFrame:self.contentView.bounds];
    [self.contentView addSubview:self.myImageView];
    self.myImageView.backgroundColor = [UIColor lightGrayColor];
}

-(void)setPhotoUrl:(NSString *)photoUrl
{
   _photoUrl = photoUrl;
    NSURL *url = [NSURL URLWithString:_photoUrl];
    [self.myImageView sd_setImageWithURL:url placeholderImage:nil];
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    
}

//重新布局cell上的子视图
-(void)layoutSubviews
{
    //当当前的cell的frame重新设置的时候,该方法会被自动执行
    [super layoutSubviews];
    self.myImageView.frame = self.contentView.bounds;
}


@end
